const base = 'cbv.aux.task';

/**
 * 查询任务列表
 * @param {*} param0
 * @returns
 */
// eslint-disable-next-line no-shadow
export function search({ pg, search }) {
  return RSocket.rs({
    route: `${base}.search`,
    args: {
      pg: { ...pg },
      search: {
        ...search,
      },
    },
  });
}

/**
 * 查询任务列表数量
 * @param {*} param0
 * @returns
 */
// eslint-disable-next-line no-shadow
export function count({ search }) {
  return RSocket.rr({
    route: `${base}.search.count`,
    args: {
      search: {
        ...search,
      },
    },
  });
}

/**
 * 查询任务列表数量
 * @param {*} param0
 * @returns
 */
// eslint-disable-next-line no-shadow
export function get(id) {
  return RSocket.rr({
    route: `${base}.${id}.search`,
  });
}

/**
 * 修改司机状态
 * @param {*} param0
 * @returns
 */
// eslint-disable-next-line no-shadow
export function updateState(id, args) {
  return RSocket.rr({
    route: `${base}.${id}.update.state`,
    args: { ...args },
  });
}

/**
 * 修改任务
 * @param {*} param0
 * @returns
 */
// eslint-disable-next-line no-shadow
export function update(data) {
  return RSocket.rr({
    route: `${base}.update`,
    data: { ...data },
  });
}
